#include <iostream>
#include <vector>
#include <deque>
using namespace std;
int dx[4]={-1,-1,1,1};
int dy[4]={-1,1,1,-1};
int ix[4]={-1,-1,0,0};
int iy[4]={-1,0,0,-1};
string s="\\/\\/";
int main()
{
	int R,C;
	int t;
	cin>>t;
	
	while(t--)
	{
		cin>>R>>C;
		vector<vector<char>> arr(R,vector<char>(C));
		for(int i=0;i<R;i++)
			for(int j=0;j<C;j++)
				cin>>arr[i][j];
		if((R+C)%2!=0)
		{
			cout<<"NO SOLUTION"<<endl;
			continue;
		}		
		queue<pair<int,int>> q;
		q.push({0,0});
		while(q.size())
		{
			
		}
	}
	return 0;
}
